package by.admonko.universaltesting.datamodel;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToOne;

@Entity
public class Answer {
	/*
	 * id serial NOT NULL, question_id integer NOT NULL, ans_text character
	 * varying(2000), ans_media character varying(2000), ans_rating integer,
	 */
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	private Integer id;

	@ManyToOne(fetch = FetchType.LAZY, targetEntity = Question.class)
	private Question question;

	@Column
	private String ansText;

	@Column
	private String ansMedia;

	@Column
	private Integer ansRating;

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public Question getQuestion() {
		return question;
	}

	public void setQuestion(Question question) {
		this.question = question;
	}

	public String getAnsText() {
		return ansText;
	}

	public void setAnsText(String ansText) {
		this.ansText = ansText;
	}

	public String getAnsMedia() {
		return ansMedia;
	}

	public void setAnsMedia(String ansMedia) {
		this.ansMedia = ansMedia;
	}

	public Integer getAnsRating() {
		return ansRating;
	}

	public void setAnsRating(Integer ansRating) {
		this.ansRating = ansRating;
	}

}
